package com.taxi.driver.module.recruit;

import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;

import com.taxi.driver.R;
import com.taxi.driver.common.BaseActivity;
import com.taxi.driver.util.Navigate;
import com.taxi.driver.widget.dialog.TimeSelectorDialog;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 司机 信息录入
 * Created by Curry on 2018/5/9.
 */

public class DriverInfoEntryActivity extends BaseActivity
{


    @BindView(R.id.et_driver_data)
    MyEditText  et_driver_data;
    @BindView(R.id.bt_next)
    Button bt_next;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.info_entry_activity);
        ButterKnife.bind(this);

        et_driver_data.setOnTouchListener((v, event) ->
        {
            switch (event.getAction()){
                case MotionEvent.ACTION_DOWN:
                    new TimeSelectorDialog(DriverInfoEntryActivity.this,
                            "初次领取驾照日期", System.currentTimeMillis(), (year, month, day) -> et_driver_data.setText(year+month+day)).show();
                    break;
            }

            return true;
        });
    }
    @OnClick({R.id.bt_next,R.id.et_driver_data})
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.bt_next:
                Navigate.openCarInfoEntryView(this);
                break;
        }
    }
}
